Skip to content

feat: add docs snippet sync pipeline and new documentation snippets#1437

Merged
PHOL-DA merged 3 commits intohyperledger-labs:mainfrom
b9lab:is/add-new-docs-sync-scripts
Apr 21, 2026
Merged

feat: add docs snippet sync pipeline and new documentation snippets#1437
PHOL-DA merged 3 commits intohyperledger-labs:mainfrom
b9lab:is/add-new-docs-sync-scripts

Conversation

@8bitpal
Copy link
Copy Markdown
Contributor

@8bitpal 8bitpal commented Mar 10, 2026

Adds a GitHub Actions workflow, extraction script, and export config to automatically sync code snippets from this repo to the canton.network docs repo.

  1. .github/workflows/update-docs-snippets.yml — triggers on pushes to main that touch snippets/ or scripts/, runs extraction, uploads artifacts, and triggers an update workflow in the docs repo
  2. docs/scripts/generateOutputDocs.js — reads docs/config/exportConfig.json and extracts 78 snippets from source files into docs-output/*.mdx, supporting full-file, line-range, string-marker, regex-wrap, and JSON-index extraction modes
  3. docs/config/exportConfig.json — maps 78 snippet names to source file locations across snippets/, scripts/, and bash/ examples
  4. Three new tested snippets in docs/wallet-integration-guide/examples/snippets/:
    • submit-with-retry.ts — retry pattern with exponential backoff for ledger contention
    • query-active-contracts-by-party.ts — querying active contracts scoped to a party via the SDK
    • fetch-pending-transfer-instructions.ts — fetching pending transfer instructions using fetchPendingTransferInstructionView()

The new snippets follow the existing snippets.test.ts auto-discovery pattern.

Signed-off-by: Ibo Sy ibo@b9lab.com

@8bitpal 8bitpal requested review from a team as code owners March 10, 2026 20:44
Copy link
Copy Markdown
Contributor

@PHOL-DA PHOL-DA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments

Comment thread docs/wallet-integration-guide/examples/snippets/submit-with-retry.ts Outdated
Comment thread docs/scripts/generateOutputDocs.js Outdated
Comment thread docs/scripts/generateOutputDocs.js Outdated
Comment thread docs/scripts/generateOutputDocs.js Outdated
Comment thread docs/scripts/generateOutputDocs.js Outdated
Comment thread .github/workflows/update-docs-snippets.yml Outdated
Comment thread .github/workflows/update-docs-snippets.yml Outdated
@8bitpal 8bitpal marked this pull request as draft March 11, 2026 05:49
@coldice
Copy link
Copy Markdown
Contributor

coldice commented Apr 15, 2026

Export config and scripts updated - export config snippet list in sync with main

@coldice
Copy link
Copy Markdown
Contributor

coldice commented Apr 20, 2026

  • Reverted (removed) added snippet files
  • Added a flag ENABLE_SYNC_PROCESS which must be set to true for the workflow to run (both automatically and manually triggered)

@coldice coldice force-pushed the is/add-new-docs-sync-scripts branch from 3314d59 to b449ff1 Compare April 20, 2026 21:10
…js syntax and tabs for prettier

Signed-off-by: Ibo Sy <ibo@b9lab.com>
@coldice coldice force-pushed the is/add-new-docs-sync-scripts branch from 9b2daa7 to a127822 Compare April 20, 2026 21:34
@8bitpal 8bitpal marked this pull request as ready for review April 21, 2026 08:22
@PHOL-DA PHOL-DA enabled auto-merge (squash) April 21, 2026 17:23
@PHOL-DA PHOL-DA merged commit b94e0fd into hyperledger-labs:main Apr 21, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants